package com.shenmazong.factory;

/**
 * @program: server-java-demo
 * @description: FruitFactory
 * @author: 亮子说编程
 * @create: 2020-10-15 16:18
 **/
public class FruitFactory {
    public static final int TYPE_APPLE = 1;
    public static final int TYPE_BANANA = 2;

    public static IFruit createFruits(int type) {
        switch (type) {
            case TYPE_APPLE:
                return new Apple();
            case TYPE_BANANA:
                return new Banana();
            default:
                return new Apple();
        }
    }
}
